/*
 * Seriennamen prüfen..
 */
function CheckName()
{
    var name = document.series_form.series_name.value;
    var xmlhttp;
    if (name.length == 0)
    {
        document.getElementById("check_name").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_name").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_name").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check_series.php?q=name&val=" + name, true);
    xmlhttp.send();
}

/*
 * Serienkürzel prüfen..
 */
function CheckShortcut()
{
    var shortcut = document.series_form.shortcut.value;
    var xmlhttp;
    if (name.length == 0)
    {
        document.getElementById("check_shortcut").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_shortcut").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_shortcut").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check_series.php?q=shortcut&val=" + shortcut, true);
    xmlhttp.send();
}

/*
 * Liganamen prüfen..
 */
function CheckLeagueName()
{
    var name = document.league_form.league_name.value;
    var xmlhttp;
    if (name.length == 0)
    {
        document.getElementById("check_name").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_name").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_name").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check_league.php?q=name&val=" + name, true);
    xmlhttp.send();
}

/*
 * Ligakürzel prüfen..
 */
function CheckLeagueShortcut()
{
    var shortcut = document.league_form.shortcut.value;
    var xmlhttp;
    if (name.length == 0)
    {
        document.getElementById("check_shortcut").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_shortcut").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_shortcut").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check_league.php?q=shortcut&val=" + shortcut, true);
    xmlhttp.send();
}